<!DOCTYPE html>
<html lang="zh-CN"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="layout/login">
<head>
<meta charset="UTF-8">
<title>登录</title>
<script type="text/javascript">

	function changeLoginType(type,changeType) {
		Release.change(type,changeType,"[[@{/login}]]");
	}
	
	function checkLoginUser(){
		if($(".username").val() == ""||$().val() == ""){
			$(".error").text("用户名或密码不能为空！");
			return false;
		}
		return true;
	}

	function refresh(){
		location.href = "[[@{/login}]]";
	}
</script>
</head>
<body>
	<div layout:fragment="content" th:remove="tag">
		<div
			th:replace="fragments/tool :: tipMessage (type='',content=${message})" th:remove="tag"></div>
		<div class="blank-div"></div>
		<div class="row qrcode_div_center">
			<div class="qrcode_background">
				<img alt="" th:src="@{/assets/img/loginimages/qrtoptext.png}"
					src="../../../assets/img/loginimages/qrtoptext.png" class="toptext" />
					<th:block th:if="${#strings.equals(qrcode.returnCode,'0') or #strings.equals(qrcode.returnCode,'1000')}">
						<br/>
						<img th:src="${qrcode.qrurl}" class="qrcode_img"/>
						<div class="qrcode_des"><lable>请扫描QR码登录</lable></div>
					</th:block>
					
					<th:block th:if="${qrcode.returnCode} !=0">
						<div class="code-error" onclick="refresh()">
							<p><th:block th:text="${qrcode.returnMessage}"></th:block><a th:href="@{/login}">请刷新</a></p>
						</div>
					</th:block>
					<input type="hidden" th:value="${qrcode.returnCode}" class="return-code"/>
					<input type="hidden" th:value="${qrcode.statusToken}" class="code"/>
				<div class="time_out" onclick="refresh()">
					<p>二维码已过期,<a th:href="@{/login}">请刷新</a></p>
				</div>
				<button onclick="changeLoginType('qrcode_background','pwd_background')" type="button" class="pswbt"></button>
			</div>
			<div class="pwd_background">
				<form class="login-form" th:action="@{/login}" method="post" onsubmit="return checkLoginUser()">
					<img alt="" th:src="@{/assets/img/loginimages/pswbg.png}"
						src="../../../assets/img/loginimages/pswbg.png" class="toptext" />
					<div class="username-div">
						<input type="text" class="username required" name="username" maxlength="61" /> 
					</div>
					<div class="password-div">
						<input type="password" class="password required" maxlength="20" name="password" />
					</div>
					<div class="error-div">
						<font class="error"></font>
					</div>
					<div style="margin-bottom:20px; height: 38px;">
						<button type="submit" class="commit"></button>
					</div>
					<shiro:has-permission name="ssssss:sss">
						<button onclick="changeLoginType('pwd_background','qrcode_background')"type="button" class="qrbt"></button>
					</shiro:has-permission>
				</form>
			</div>
		</div>
		<div class="footer_login">
			Copyright &copy; 2016  SFCST, Inc. All Rights Reserved
		</div>
	</div>


</body>
</html>